package com.base.cn.platform.os.service.course.classes.task;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.course.CourseBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 作业数据接口
 *
 * @author s.li
 * @date 2018/12/24
 */
@FeignClient(value = CourseBaseService.appName, configuration = FeignAuthConfig.class)
public interface ClassesTaskDataService extends CourseBaseService {

    /**
     * 保存作业数据
     * @param examId 作业ID
     * @param status 作业的状态
     * @param subjectIds 作业的专业ID串
     * @param courseIds 课程ID串
     * @param classesIds 班级ID串
     */
    @RequestMapping(contextPath + "/saveClassesTaskData")
    void saveClassesTaskData(@RequestParam("examId") BigDecimal examId,
                             @RequestParam("status") int status,
                             @RequestParam("subjectIds") String subjectIds,
                             @RequestParam(value = "courseIds", required = false) String courseIds,
                             @RequestParam(value = "classesIds", required = false) String classesIds);

    /**
     * 删除作业数据
     * @param examIds 作业ID串
     */
    @RequestMapping(contextPath + "/deleteClassesTaskDataByIds")
    void deleteClassesTaskDataByIds(@RequestParam("examIds") String examIds);

    /**
     * 修改作业状态
     * @param examIds 作业ID
     * @param status 状态
     */
    @RequestMapping(contextPath + "/updateClassesTaskDataStatus")
    void updateClassesTaskDataStatus(@RequestParam("examIds") String examIds,
                                     @RequestParam("status") int status);

    /**
     * 查询用户作业数据
     * @param condition 查询条件
     * @return PageInfo<ClassesTaskData>
     */
    @RequestMapping(contextPath + "/findUserTaskDataList")
    List<BigDecimal> findUserTaskDataList(@RequestBody Map<String, Object> condition);
}
